<!--#include file="lib/utf-8.asp"-->
<!--#include file="lib/conn.asp"-->
<%
Dim i,Rs,Sql,Table,Column,Bool,cmd,dt
Table = "yb"
Column = "hz"
dt="nvarchar(50)"
Bool = False
sql="Select * From ["&Table&"]"
Set Rs = Conn.ExeCute(Sql)
For Each i In Rs.Fields
'Response.Write(i.Name&"<br>")
	If i.Name=Column Then
		Bool = True
		Exit For
	End If
Next
rs.close
Set rs=nothing
If Bool Then
	Response.Write("在《"&Table&"》表中,存在《"&Column&"》列!")
Else
	Response.Write("在《"&Table&"》表中,不存在《"&Column&"》列!")
	set cmd=server.CreateObject ("adodb.command")
	set cmd.ActiveConnection =conn
	'sql="alert table 表名 add 列名 数据类型 "
	sql="alter table "&Table&" add column "&Column&" "&dt
	response.write sql
	'response.end
	cmd.CommandText =sql
	cmd.Execute
End If
%>